package com.jeesite.modules.student.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.student.entity.Student;
import com.jeesite.modules.student.dao.StudentDao;

/**
 * 学生表Service
 * @author ccz
 * @version 2025-03-20
 */
@Service
public class StudentService extends CrudService<StudentDao, Student> {

	@Autowired
	private StudentDao studentDao;

	/**
	 * 获取单条数据
	 * @param student
	 * @return
	 */
	@Override
	public Student get(Student student) {
		return super.get(student);
	}
	
	/**
	 * 查询分页数据
	 * @param student 查询条件
	 * @param student.page 分页对象
	 * @return
	 */
	@Override
	public Page<Student> findPage(Student student) {

		return super.findPage(student);
	}
	
	/**
	 * 查询列表数据
	 * @param student
	 * @return
	 */
	@Override
	public List<Student> findList(Student student) {
		return super.findList(student);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param student
	 */
	@Override
	@Transactional
	public void save(Student student) {
		super.save(student);
	}
	
	/**
	 * 更新状态
	 * @param student
	 */
	@Override
	@Transactional
	public void updateStatus(Student student) {
		super.updateStatus(student);
	}
	
	/**
	 * 删除数据
	 * @param student
	 */

	public void batchDeleteByCondition(List<String> condition) {
		if (condition!=null){
			System.out.println(condition.toString());
			for (String id:condition){
				System.out.println("----------------------------------------"+id);
				studentDao.batchDeleteByCondition(id);
			}
		}
	}
}